// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.

// import 'babel-polyfill'     //注意:这条引入要在 import Vue from ‘vue’ 之前
import Vue from 'vue'
import App from './App'
import router from './router'
import store from './store'

import Vant from 'vant'; 
import 'vant/lib/index.css'; 
Vue.use(Vant)

import Contextmenu from 'vue-contextmenujs';
Vue.use(Contextmenu);

// import Es6Promise from 'es6-promise'
// Es6Promise.polyfill()

import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);

import api from '@/utils/api'
import * as localStorage from '@/utils/localStorage.js'
import * as myurl from '@/utils/myurl.js'

Vue.config.productionTip = false
Vue.prototype.$api = api
Vue.prototype.$localStorage = localStorage
Vue.prototype.$myurl = myurl


Vue.filter('jiexiType', function (value) {
  if (value === '1') {
    return '审核中'
  } else if (value === '2') {
    return '审核通过'
  } else if (value === '3') {
    return '审核未通过'
  }
})
Vue.filter('allFiter', function (value) {
  
  if (value === '1') {
    return '审核中'
  } else if (value === '2') {
    return '审核通过'
  } else if (value === '3') {
    return '审核未通过'
  }
})


Vue.filter('formatDate', function (value) {
  let date = new Date(value)
  let y = date.getFullYear()
  let MM = date.getMonth() + 1
  MM = MM < 10 ? ('0' + MM) : MM
  let d = date.getDate()
  d = d < 10 ? ('0' + d) : d
  let h = date.getHours()
  h = h < 10 ? ('0' + h) : h
  let m = date.getMinutes()
  m = m < 10 ? ('0' + m) : m
  let s = date.getSeconds()
  s = s < 10 ? ('0' + s) : s
  return y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s
})

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
})
